package com.k2091.washcar.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.k2091.washcar.entity.WxUserinfo;
import com.k2091.washcar.service.IWxUserinfoService;
import com.k2091.washcar.service.impl.WxUserinfoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author author
 * @since 2021-06-01
 */
@RestController
@RequestMapping("/wx-userinfo")
public class WxUserinfoController {

    @Autowired
    private IWxUserinfoService wxUserinfoService;

    @GetMapping("/wxuserinfo")
    public WxUserinfo findWxUserinfo(String openid) {
        QueryWrapper<WxUserinfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("openid", openid);
        return wxUserinfoService.getOne(queryWrapper);
    }

}
